using System;
using System.Collections.Generic;

namespace DesignPattern.Creational.Builder
{
    public class Meal
    {
        private List<IItem> _items = new List<IItem>();

        public void AddItem(IItem item)
        {
            _items.Add(item);
        }

        public Decimal GetCost()
        {
            Decimal cost = 0.00M;

            foreach (var item in _items)
            {
                cost += item.Price();
            }

            return cost;
        }

        public void ShowItems()
        {
            foreach (var item in _items)
            {
                System.Console.WriteLine($"Item: {item.Name()}, Packing: {item.Packing()}, Price: {item.Price()}");
            }
        }
    }
}